#include "../terra-ge.h"

#ifndef TERRAGE_BMANAGER_H_INCLUDED
#define TERRAGE_BMANAGER_H_INCLUDED

namespace TerraGE {
    class Bitmap {
        protected:
            string name;
            ALLEGRO_BITMAP *bit;
        public:
            Bitmap(string nm, ALLEGRO_BITMAP *b);
            Bitmap(string nm);

            ALLEGRO_BITMAP *Get_Bit() {return bit;}
            void Set_Bit(ALLEGRO_BITMAP *b) {bit=b;}

            int Width() {if (bit) return al_get_bitmap_width(bit);}
            int Height() {if (bit) return al_get_bitmap_height(bit);}

            std::string Get_Name() {return name;}

            ~Bitmap() {if (bit) al_destroy_bitmap(bit);}
    };

    class Bitmap_Manager {
        protected:
            list<Bitmap *> bitmaps;
        public:
            Bitmap_Manager();

            Bitmap *Get_Bitmap(string nm);
            void Add_Bitmap(string nm, ALLEGRO_BITMAP *bit);
    };
}

#endif
